from socket import *

# Set the socket parameters
host = "192.168.1.201"
port = 8081
buf = 1024
addr = (host,port)

# Create socket
TCPSock = socket(AF_INET,SOCK_STREAM)
TCPSock.connect(addr)  
def_msg = "===Enter message to send to server===";
print "\n",def_msg

# Send messages
while (1):
	data = raw_input('>> ')
	if not data:
		break
	else:
		if(TCPSock.sendto(data,addr)):
			print "Sending message '",data,"'....."
			
	sReceive = TCPSock.recv(1024);
	print 'Received: %s' % sReceive;

# Close socket
TCPSock.close()
